<template>
  <div id="list-project-page">
    <div class="row flex">
      <template v-for="(k, i) in list">
        <icon-card :key="i">
          <template #icon>
            <svg
              t="1589694101238"
              class="icon"
              viewBox="0 0 1024 1024"
              version="1.1"
              xmlns="http://www.w3.org/2000/svg"
              p-id="6628"
              width="22"
              height="22"
            >
              <path
                d="M942.08 0 81.92 0C36.675584 0 0 36.675584 0 81.92l0 860.16c0 45.244416 36.675584 81.92 81.92 81.92l860.16 0c45.244416 0 81.92-36.675584 81.92-81.92L1024 81.92C1024 36.675584 987.324416 0 942.08 0zM270.336 796.672 147.456 796.672l0-122.88 122.88 0L270.336 796.672zM270.336 573.44 147.456 573.44l0-122.88 122.88 0L270.336 573.44zM270.336 350.208 147.456 350.208l0-122.88 122.88 0L270.336 350.208zM874.496 776.192 342.016 776.192l0-81.92 532.48 0L874.496 776.192zM874.496 552.96 342.016 552.96l0-81.92 532.48 0L874.496 552.96zM874.496 329.728 342.016 329.728l0-81.92 532.48 0L874.496 329.728z"
                p-id="6629"
                fill="#ffffff"
                data-spm-anchor-id="a313x.7781069.0.i6"
                class="selected"
              ></path>
            </svg>
          </template>
          <template #icon-description>
            <div class="name">{{ k.projectName }}</div>
          </template>
          <template #icon-do>
            <button>打开项目</button>
            <button>删除项目</button>
            <button>修改项目</button>
          </template>
        </icon-card>
      </template>
    </div>
  </div>
</template>

<script lang="ts">
  import { Vue, Component, Prop, Watch } from 'vue-property-decorator';
  import iconCard from './components/IconCard.vue'
  import project from '../../../script/file/project';

  @Component({
    name: 'index',
    components: {
      iconCard,
    },
  })
  export default class index extends Vue {
    list: any[] = [];

    mounted() {
      this.$root.$data.electron.readFile('./project/projectList.json').then((v) => {
        this.list = JSON.parse(v).list;
      });
    }

    onOpen() {}
    onCheck() {
      this.$root.$data.electron.readFile(`./project/`).then((v) => {
        console.log(v);
      });
    }
  }
</script>
<style scoped></style>
